clear; close all;


% event window
NOBS_before = 24;
NOBS_after  = 10*12;


% load crisis simulation
load crisis_simulation_out.mat MOM5 state1 state2


% load other output
load model_solution.mat ATM_Asset_IV


% Figure 5
ff = figure('Position', [100, 100, 480, 400]);
set(ff,'Units','Inches');
pos = get(ff,'Position');
set(ff,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
subplot = @(m,n,p)subtightplot(m, n, p, [0.1 0.1], [0.14 0.02], [0.11 0.03]);

subplot(1,1,1); hold on;
plot((-NOBS_before:NOBS_after-1)/12,100*(mean(state1,2)*ATM_Asset_IV(1)+mean(state2,2)*ATM_Asset_IV(2)+mean(1-state1-state2,2)*ATM_Asset_IV(3)),'r-','LineWidth',1.5);
grid on; set(gca,'FontSize',12); xlim([-1,7]); ylim([10,90])
ylabel('Volatility (% p.a.)','FontSize',15);
xlabel('Event Time (Years)','FontSize',15);
plot((-NOBS_before:NOBS_after-1)/12,mean(MOM5,2),'k:','LineWidth',1.5);
hold off; box off;
leg=legend('Asset options (model)','Equity options (model)','Location','NE'); set(leg,'FontSize',10.5,'color','none');

print(gcf,'figure_5','-dpdf','-r0')





